<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>固定定位</title>

        <style>
            .red {
                position:fixed;
                top: 100px;
                right: 100px;

                width: 200px;
                height: 200px;
                background-color: red;
            }

            .blue {
                width: 200px;
                height: 2000px;

                background-color: blue;
            }
        </style>
    </head>
    <body>
        <!-- 
            1.固定于谁？
                - 固定于浏览器窗口
         -->

         <div class="box red"></div>
         <div class="box blue"></div>
    </body>
</html>